﻿<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:lib="clr-namespace:SearchWPF"
    Title="Search WPF" Height="372" Width="724" Name="Window1">
	<Window.CommandBindings>
		<CommandBinding Command="lib:AppCommand.GoBack" CanExecute="Prior_CanExecute" Executed="GoBack"/>
		<CommandBinding Command="lib:AppCommand.GoNext" CanExecute="Next_CanExecute" Executed="GoNext"/>
		<CommandBinding Command="lib:AppCommand.GoUp" CanExecute="Always_CanExecute" Executed="GoUp"/>
		<CommandBinding Command="lib:AppCommand.FocusFilter" CanExecute="Always_CanExecute" Executed="FocusFilter"/>
	</Window.CommandBindings>
	<Window.Resources>
		<!--<Style TargetType="ComboBox">
			<Setter Property="Foreground" Value="#bbe2ee" />
		</Style>
		<Style TargetType="TextBlock">
			<Setter Property="Foreground" Value="#bbe2ee"/>
		</Style>
		<Style TargetType="TextElement">
			<Setter Property="Foreground" Value="#bbe2ee"/>
		</Style>
		<Style TargetType="Control">
			<Setter Property="Foreground" Value="#bbe2ee" />
		</Style>
		<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="#bbe2ee"/>
		<Style x:Key="WindowStyle">
			<Setter Property="Window.Background">
				<Setter.Value>
					<RadialGradientBrush GradientOrigin="0.9,0.9" RadiusX=".8" RadiusY=".9">
						<RadialGradientBrush.GradientStops>
							<GradientStop Color="#37576b" Offset="0"/>
							<GradientStop Color="#13404e" Offset="1"/>
						</RadialGradientBrush.GradientStops>
					</RadialGradientBrush>
				</Setter.Value>
			</Setter>
		</Style>-->
		<lib:BoolToVisibilityConverter x:Key="BoolToVisConverter"/>
	</Window.Resources>
	<Grid>
		<Grid Name="ctlInfo">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="400"/>
				<ColumnDefinition/>
			</Grid.ColumnDefinitions>
			<Grid Margin="8">
				<Grid.RowDefinitions>
					<RowDefinition Name="Row1" Height="168"/>
					<RowDefinition/>
				</Grid.RowDefinitions>

				<StackPanel>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="90"/>
							<ColumnDefinition/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
						</Grid.RowDefinitions>
						<Label Target="{Binding ElementName=ctlAccess}" Grid.Row="0" Grid.Column="0">_Access</Label>
						<ComboBox  Background="{x:Null}" Grid.Row="0" Grid.Column="1"  IsEditable="True" Name="ctlAccess">
						</ComboBox>
						<Label Target="{Binding ElementName=ctlNamespaces}" Grid.Row="1" Grid.Column="0" >_Namespaces:</Label>
						<ComboBox Background="{x:Null}" Grid.Row="1" Grid.Column="1" IsEditable="True" Name="ctlNamespaces"/>
						<Label Target="{Binding ElementName=ctlInheritsFrom}" Grid.Row="2" Grid.Column="0" >Inherits fr_om:</Label>
						<ComboBox Background="{x:Null}" Grid.Row="2" Grid.Column="1" Text="UIElement" IsEditable="True" Name="ctlInheritsFrom"/>
						<Label Target="{Binding ElementName=ctlImplements}" Grid.Row="3" Grid.Column="0" >_Implements:</Label>
						<ComboBox Background="{x:Null}" Grid.Row="3" Grid.Column="1" IsEditable="True" Name="ctlImplements"/>

						<Label Target="{Binding ElementName=ctlInherited}" Grid.Row="4" Grid.Column="0"  VerticalAlignment="Top">Inherite_d:</Label>
						<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1">
							<TextBox Background="{x:Null}" Width="70" Name="ctlInherited">0</TextBox>
							<CheckBox Margin="10,0,0,0" Width="80" Name="ctlSingleList" Content="_Single list" VerticalAlignment="Center" />
							<Label BorderBrush="{x:Null}" Background="{x:Null}" Foreground="Gray" Width="70" VerticalAlignment="Center" Name="Label1">
								<TextBlock TextDecorations="Underline">Prior</TextBlock>
							</Label>
							<Label BorderBrush="{x:Null}" Background="{x:Null}" Foreground="Gray" Width="60" VerticalAlignment="Center" Name="ctlForward">
								<TextBlock TextDecorations="Underline">Next</TextBlock>
							</Label>
						</StackPanel>
						<Label Grid.Row="5" Grid.Column="0"  VerticalAlignment="Top">Display:</Label>
						<StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="1">
							<CheckBox Width="80" Name="ctlDisplayProperties" IsChecked="True" Content="_Properties" VerticalAlignment="Center" />
							<CheckBox Width="80" Name="ctlDisplayMethods" Content="_Methods" VerticalAlignment="Center" />
							<CheckBox Width="80" Name="ctlDisplayEvents" Content="_Events" VerticalAlignment="Center" />
							<CheckBox Width="80" Name="ctlDisplayFields" Content="_Fields" VerticalAlignment="Center" />
						</StackPanel>
					</Grid>
				</StackPanel>

				<lib:ucFilter x:Name="ctlFilter" Grid.Row="1"/>
			</Grid>


			<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"  Margin="8" Grid.Column="1">
				<StackPanel  >
					<TextBlock DataContext="{Binding ElementName=ctlFilter}">
			Class: <TextBlock FontWeight="Bold" FontSize="15" Text="{Binding Path=SelectedItem.Name}"/>
			<LineBreak/>
			<LineBreak/>
			Access: <TextBlock Text="{Binding Path=SelectedItem.AccessName}"/>
			<LineBreak/>
			Namespace: <TextBlock Text="{Binding Path=SelectedItem.NamespaceName}"/>
			<LineBreak/>
			<LineBreak/>
		</TextBlock>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition/>
							<ColumnDefinition/>
						</Grid.ColumnDefinitions>
						<StackPanel Grid.Column="0">
							<TextBlock FontWeight="Bold">Inherits from:</TextBlock>
							<ListView Background="{x:Null}" Name="ctlInheritsList" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.InheritsFrom}" DisplayMemberPath="." >
								<ListView.Resources>
									<Style TargetType="{x:Type ListViewItem}">
										<EventSetter Event='MouseDoubleClick' Handler='ctlInheritsFrom_MouseDoubleClick'/>
									</Style>
								</ListView.Resources>
							</ListView>
						</StackPanel>
						<StackPanel Grid.Column="1">
							<TextBlock FontWeight="Bold">Implements:</TextBlock>
							<ListView Background="{x:Null}" Name="ctlImplementsList" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.ImplementsList}" DisplayMemberPath="." >
								<ListView.Resources>
									<Style TargetType="{x:Type ListViewItem}">
										<EventSetter Event='MouseDoubleClick' Handler='ctlImplementsList_MouseDoubleClick'/>
									</Style>
								</ListView.Resources>
							</ListView>
						</StackPanel>
					</Grid>
					<StackPanel Visibility="{Binding ElementName=ctlSingleList,Path=IsChecked,Converter={StaticResource BoolToVisConverter},ConverterParameter=False}">
						<StackPanel Visibility="{Binding ElementName=ctlDisplayProperties,Path=IsChecked,Converter={StaticResource BoolToVisConverter}}">
							<TextBlock><LineBreak/><TextBlock FontWeight="Bold">Properties:</TextBlock> (<TextBlock Text="{Binding ElementName=ctlFilter, Path=SelectedItem.Properties.Count}"/>)</TextBlock>
							<ListView Background="{x:Null}" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.Properties}" DisplayMemberPath="Text" />
						</StackPanel>

						<StackPanel Visibility="{Binding ElementName=ctlDisplayMethods,Path=IsChecked,Converter={StaticResource BoolToVisConverter}}">
							<TextBlock><LineBreak/><TextBlock FontWeight="Bold">Methods:</TextBlock> (<TextBlock Text="{Binding ElementName=ctlFilter, Path=SelectedItem.Methods.Count}"/>)</TextBlock>
							<ListView Background="{x:Null}" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.Methods}" DisplayMemberPath="Text" />
						</StackPanel>

						<StackPanel Visibility="{Binding ElementName=ctlDisplayEvents,Path=IsChecked,Converter={StaticResource BoolToVisConverter}}">
							<TextBlock><LineBreak/><TextBlock FontWeight="Bold">Events:</TextBlock> (<TextBlock Text="{Binding ElementName=ctlFilter, Path=SelectedItem.Events.Count}"/>)</TextBlock>
							<ListView Background="{x:Null}" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.Events}" DisplayMemberPath="Text" />
						</StackPanel>

						<StackPanel Visibility="{Binding ElementName=ctlDisplayFields,Path=IsChecked,Converter={StaticResource BoolToVisConverter}}">
							<TextBlock><LineBreak/><TextBlock FontWeight="Bold">Fields:</TextBlock> (<TextBlock Text="{Binding ElementName=ctlFilter, Path=SelectedItem.Fields.Count}"/>)</TextBlock>
							<ListView Background="{x:Null}" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.Fields}" DisplayMemberPath="Text" />
						</StackPanel>
					</StackPanel>
					<StackPanel Visibility="{Binding ElementName=ctlSingleList,Path=IsChecked,Converter={StaticResource BoolToVisConverter},ConverterParameter=True}">
						<TextBlock><LineBreak/><TextBlock FontWeight="Bold">Members:</TextBlock> (<TextBlock Text="{Binding ElementName=ctlFilter, Path=SelectedItem.SingleList.Count}"/>)</TextBlock>
						<ListView Background="{x:Null}" BorderBrush="{x:Null}" ItemsSource="{Binding ElementName=ctlFilter, Path=SelectedItem.SingleList}" DisplayMemberPath="Text" />
					</StackPanel>
				</StackPanel>
			</ScrollViewer>
		</Grid>
		<Grid Name="ctlWait" Visibility="Collapsed">
			<Grid Opacity=".5" Background="#808080" />
			<ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="23"  />
			<TextBlock FontWeight="Bold" FontSize="50" VerticalAlignment="Center" HorizontalAlignment="Center">Updating</TextBlock>
		</Grid>
	</Grid>
</Window>
